package com.file.manage.controller;


import com.file.manage.domain.data.FileVO;
import com.file.manage.domain.entity.FolderStencil;
import com.file.manage.domain.request.FileCopyMoveRequest;
import com.file.manage.domain.request.SaveFolderStencilRequest;
import com.file.manage.domain.response.UploadTmpFileResponse;
import com.file.manage.domain.service.FileService;
import com.file.manage.domain.service.FolderStencilService;
import com.file.manage.infrastructure.base.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @since 2025-05-22
 */
@RestController
@RequestMapping("folder-stencil")
@Tag(name = "文件模版管理")
@Slf4j
public class FolderStencilController {
    @Resource
    private FolderStencilService folderStencilService;

    @Operation(summary = "新增文件夹模版")
    @PostMapping(value = "/save")
    public CommonResult<?> save(@Valid @RequestBody SaveFolderStencilRequest request) {
        folderStencilService.saveFolderStencil(request);
        return CommonResult.success();
    }

    @Operation(summary = "查询所有文件夹模版")
    @GetMapping(value = "/selectAll")
    public CommonResult<List<FolderStencil>> selectAll() {
        return CommonResult.success(folderStencilService.list(null));
    }

    @Operation(summary = "删除文件夹模版")
    @DeleteMapping(value = "/deleteById")
    public CommonResult<?> deleteById(@RequestParam(value = "id") String id) {
        folderStencilService.removeById(id);
        return CommonResult.success();
    }
}
